import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import AutoImport from "unplugin-auto-import/vite";

// https://vite.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    AutoImport({
      imports: ["vue", "@vueuse/core"],
      dts: true,
    }),
  ],

  css: {
    preprocessorOptions: {
      scss: { api: "modern-compiler" },
    },
  },

  server: {
    proxy: {
      "/api": {
        target: "http://localhost:8011",
        // target: "http://h36ed358.natappfree.cc",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ""),
      },
    },
  },
});
